<!DOCTYPE html>
<!-- pswd_chk.html
     A document for pswd_chk.ps
     -->
<html lang ="en">
  <head>

   <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>

    <title> Illustrate password checking> </title>
    <meta charset = "utf-8" />
    <script type = "text/javascript"  src = "pswd_chk.js" >
    </script>

<script language="JavaScript" type="text/javascript"> 
  function changeBtnable(){
      $("#submit").removeAttr("disabled");
  }
  function changeBtndisable(){
      $("#submit").attr("disabled",true)  
    }
    function checkInput(){
      var text = $("#second").val();
      if(text==null||text==""){
          changeBtndisable();
      }
  }
  function changeVerifyable(){
      $("#second").removeAttr("disabled");
  }
  function changeVerifydisable(){
      $("#second").attr("disabled","true");
  }
  function checkInput2(){
      var text = $("#initial").val();
      if(text==null||text==""){
          changeVerifydisable();
      }
  }  
</script>
  </head>
  <body>
    <h3> Password Input </h3>
    <form id = "myForm"  action = "" >
      <p>
      
      <label> Your password 
        <input type = "password" id = "initial"  
               size = "10" onmouseleave="checkInput2()" oninput="changeVerifyable()"/>
      </label>
      <br /><br />
 
      <label> Verify password 
        <input type = "password"  id = "second" 
               size = "10" onmouseleave="checkInput()" oninput="changeBtnable()"/>
      </label>
      <br /><br />

      <input type = "reset"  name = "reset" />
      <input type = "submit"  name = "submit" />
      </p>
    </form>

<!-- Script for registering the event handlers  -->
    <script type = "text/javascript"  src = "pswd_chkr.js">
    </script>
  </body>
</html>
